Revert "luci-base: override the load() function to return boolean for FlagValue"
authorPaul Donald <[email protected]>
Thu, 12 Jun 2025 12:51:23 +0000 (14:51 +0200)
committerPaul Donald <[email protected]>
Thu, 12 Jun 2025 12:51:23 +0000 (14:51 +0200)
This reverts commit bedefb1803766f906ebb49d83740c10e9eb3db88.

Signed-off-by: Paul Donald <[email protected]>
modules/luci-base/htdocs/luci-static/resources/form.js

index 3ad5a3cc2b4262ba04951dc806240eb03f1d206d..e1fc3ff3e9dd39520ac3d1c4ceda9bbdb341c109 100644 (file)
@@ -4187,19 +4187,6 @@ const CBIFlagValue = CBIValue.extend(/** @lends LuCI.form.FlagValue.prototype */
         * @default 'ℹ️';
         */
 
-       /**
-        * Coerce the various forms of a 'boolean' string into a true/false value.
-        *
-        * @override
-        */
-       load() {
-               // 
-               let load = this.super('load', arguments);
-               if (typeof(load) == 'string')
-                       load = ['1', 'on', 'true', 'yes', 'enabled'].includes(load.toLowerCase());
-               return load;
-       },
-
        /** @private */
        renderWidget(section_id, option_index, cfgvalue) {
                let tooltip = null;